import copy

candidates = list(map(int, input().split()))
candidates.sort(reverse=True)
n = len(candidates)
target = int(input())
result = []
path = []
sums = 0


def backtracking(start_index):
    global sums
    if sums == target:
        if result and path == result[-1]: return
        result.append(copy.deepcopy(path))
        return
    if sums > target:
        return
    for i in range(start_index + 1, n):
        sums += candidates[i]
        path.append(candidates[i])

        backtracking(i)

        sums -= candidates[i]
        path.pop()


backtracking(0)
print(result)
